package com.se2.antiqueexhibition.Service.impl;


import com.se2.antiqueexhibition.Mapper.AdminAnnouncementMapper;
import com.se2.antiqueexhibition.Service.AdminActivityService;
import com.se2.antiqueexhibition.Service.AdminAnnouncementService;
import com.se2.antiqueexhibition.pojo.AdminActivity;
import com.se2.antiqueexhibition.pojo.AdminAnnouncement;
import com.se2.antiqueexhibition.pojo.Announcement;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


import java.util.Collections;
import java.util.List;

@Service
public class AdminAnnouncementServiceimpl implements AdminAnnouncementService {

    @Resource
    private AdminAnnouncementMapper adminAnnouncementMapper;

    @Override
    @Transactional
    public void insert(AdminAnnouncement a) {
        adminAnnouncementMapper.insert(a);
    }

    @Override
    public void delete(int id) {
        adminAnnouncementMapper.delete(id);

    }

    @Override
    public void update(AdminAnnouncement a) {
        adminAnnouncementMapper.update(a);
    }

    @Override
    public List<AdminAnnouncement> getAdminAnnouncements() {
        return adminAnnouncementMapper.selectAll();
    }

    @Override
    public void updateStatus(int id, int status) {
        adminAnnouncementMapper.updateStatus(id, status);

    }

}
